<html style="margin: 0;">
  <body style="margin: 0;">
    <!-- 1. The <iframe> (and video player) will replace this <div> tag. -->
    <div id="player" style="margin: 0;"></div>

    <script>
    
      // 2. This code loads the IFrame Player API code asynchronously.
      var tag = document.createElement('script');
      tag.src = "http://www.youtube.com/player_api";
      var firstScriptTag = document.getElementsByTagName('script')[0];
      firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

      // 3. This function creates an <iframe> (and YouTube player)
      //    after the API code downloads.
      var player;
      function onYouTubePlayerAPIReady() {
        player = new YT.Player('player', {
          height: '230',
          width: '230',
          videoId: '',
          playerVars: {
            controls:'0'
          },
          events: {
            'onReady': onPlayerReady
          }
        });
      }
      // 4. The API will call this function when the video player is ready.
      function onPlayerReady(event) {
        player.playVideo();
      }
      
      function duration()
      {
        return player.getDuration()
      }

      function getCurrentTime()
      {
        return player.getCurrentTime()
      }
      
      function setCurrentTime(newTime)
      {
        player.seekTo(newTime)
      }
      
      function playvid(id)
      {
        player.loadVideoById(id);
      }

      function stop() {
        player.stopVideo();
      }
      function pause()
      {
        player.pauseVideo()
      }
      function resumePause()
      {
        if(player.getPlayerState() == 2)
        {
            player.playVideo();
            return "playing"
        }
        else
        {
            player.pauseVideo();
            return "paused"
        }
      }
</script>
        
    
  </body>
  
</html>
